package com.itcast.demo.validate.controller;

import com.itcast.demo.validate.pojo.Order;
import com.itcast.demo.validate.pojo.UserGroupSequence;
import jakarta.validation.Valid;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
@Validated
public class ValidateController4 {

    // 嵌套校验
    @PostMapping("/create")
    public ResponseEntity<String> createOrder(@RequestBody @Valid Order order) {
        // 创建订单逻辑
        return ResponseEntity.ok("订单创建成功");
    }
}


